// src/app/layout.tsx
import type {Metadata} from "next";
import "./globals.css";
import AuthProvider from "@/components/auth/Provider";
import "@mantine/core/styles.css"
import {ColorSchemeScript, MantineProvider} from "@mantine/core";
import {auth} from "@/auth";
import {SessionProvider} from "next-auth/react";
import {Toast} from "@/components/ui/toast";
import {Toaster} from "sonner";
import ToasterProvider from "@/components/learn/providers/toaster-provider";
import React from "react";
import ConfettiProvider from "@/hooks/learn/confetti-provider";

export const metadata: Metadata = {
    title: "大学生就业平台",
    icons: "/logo.png",
    description: "论坛-群组-求职-学习 一站式平台",
};

export default async function RootLayout({
                                             children,
                                         }: Readonly<{
    children: React.ReactNode;
}>) {
    const session = await auth();

    return (
        <SessionProvider session={session}>
            <html lang="en">
            <head>
                <ColorSchemeScript/>
                <title>Linked</title>
            </head>
            <body
                className={`h-full w-full`}
            >
            <Toaster/>
            {/*<AuthProvider>*/}
            <MantineProvider>
                <ToasterProvider/>
                <ConfettiProvider/>
                {children}
            </MantineProvider>
            {/*</AuthProvider>*/}
            </body>
            </html>
        </SessionProvider>
    );
}
